package cn.csq.design.structural.adapter.clazz;

import cn.csq.design.structural.adapter.Player;
import cn.csq.design.structural.adapter.Translator;
import cn.csq.design.structural.adapter.ZH_JPTranslator;

/**
 * 适配器模式 通过继承的方式 类结构模式  继承实现类 调用父类的方法进行包装结果
 * @author csq
 * @date 2022/1/27 10:55:30
 */
public class JPMoviePlayerAdapter extends ZH_JPTranslator implements Player {

    private Player target;//被适配对象

    public JPMoviePlayerAdapter(Player target) {
        this.target = target;
    }

    @Override
    public String play() {
        String play = target.play();
        //转换字幕
        return translate(play);
    }

   }
